<%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2023/4/2
  Time: 11:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<%--引入jstl的核心标签库--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>jstl---容器操作</title>
</head>
<body>
<h3>小脚本写法</h3>
<%
    pageContext.setAttribute("A", "aa1", 1);
    pageContext.setAttribute("A", "aa2", 2);
    pageContext.setAttribute("A", "aa3", 3);
    pageContext.setAttribute("A", "aa4", 4);
    pageContext.removeAttribute("A", 3);
    Object obj1 = pageContext.getAttribute("A", 2);
    out.print("obj1: " + obj1);
%>
<hr/>
<c:set var="B" value="bb1" scope="page"/>
<c:set var="B" value="bb2" scope="request"/>
<c:set var="B" value="bb3" scope="session"/>
<c:set var="B" value="bb4" scope="application"/>
<c:remove var="B" scope="request"/>
1.<c:out value="B"/><br/>
2.<c:out value="${applicationScope.B}"/><br/>
3.${applicationScope.B}<br/>
4.${requestScope.B}<br/>
5.<c:out value="${requestScope.B}" default="我是默认值"/><br/>
6.<c:out value="<span>abc</span>"/><br/>
7.<c:out value="<span>abc</span>" escapeXml="false"/>
</body>
</html>
